package org.judking.CarKeeper.command.EarlyWarning;

import org.judking.CarKeeper.command.BaseObdCommand;
import org.judking.CarKeeper.service.StcActivityService;
import org.judking.CarKeeper.service.VoiceService.VoiceType;

public class FuelLevelDetector implements WarningDetector {
	public static double lowerBound = 10;
	private double curFuelLevel;
	
	@Override
	public void detect(BaseObdCommand command) {
		curFuelLevel = Double.parseDouble(command.getRipeData().toString());
		if(curFuelLevel <= lowerBound)			{
			StcActivityService.mkVoice(VoiceType.FUEL_LOW);
		}
	}

	public double getLowerBound() {
		return lowerBound;
	}

	public void setLowerBound(double lowerBound) {
		this.lowerBound = lowerBound;
	}

	public double getCurFuelLevel() {
		return curFuelLevel;
	}
	
}
